﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Management_MedicalDirector_Danhsachkhoa : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void new_click(object sender, EventArgs e)
    {
        lbTitleKH.Text = "Thêm tên khoa";
        pnInfo.Visible = true;
    }
    protected void ok_click(object sender, EventArgs e)
    {
        SqlConnection con = new SqlConnection(GlobalConstant.CONNECTION_STRING);
        con.Open();
        string sql = "INSERT INTO tbWard (Name, Location, TelExt) VALUES (@Name, @Location, @Tel)";
        SqlCommand cmd = new SqlCommand(sql, con);
        cmd.Parameters.AddWithValue("@Name", txtNameKH.Text);
        cmd.Parameters.AddWithValue("@Location", txtAddressKH.Text);
        cmd.Parameters.AddWithValue("@Tel", txtTelKH.Text);
        cmd.ExecuteNonQuery();
        GridView1.DataBind();
        txtNameKH.Text = "";
        txtAddressKH.Text = "";
        txtTelKH.Text = "";
        con.Close();

    }
    protected void cancel_click(object sender, EventArgs e)
    {
        pnInfo.Visible = false;
        lbTitleKH.Text = "";
    }
}